<template>
  <a-drawer
    width="45%"
    :title="formTitle"
    :label-col="4"
    :wrapper-col="14"
    :visible="open"
    :body-style="{ height: 'calc(100vh - 100px)', overflow: 'auto' }"
    @close="cancel"
  >
    <a-form-model ref="form" :model="form" :rules="rules" layout="vertical">
      <a-spin :spinning="spinning" :delay="delayTime" tip="Loading...">
        <a-row :gutter="32">
          <a-col :span="12">
            <a-form-item label="城市区域" prop="cityName">
              <a-select
                placeholder="所在城市"
                v-model="form.cityName"
                style="width: 100%"
                allow-clear
              >
                <a-select-option
                  v-for="(d, index) in cityOptions"
                  :key="index"
                  :value="d.name.replace('市', '')"
                  >{{ d.name }}</a-select-option
                >
              </a-select>
            </a-form-item>
          </a-col>
          <a-col :span="12">
            <a-form-model-item label="车辆状态" prop="carStatus">
              <a-select
                placeholder="请选择车辆状态"
                v-model="form.carStatus"
                :getPopupContainer="
                  (triggerNode) => {
                    return triggerNode.parentNode || document.body;
                  }
                "
                style="width: 100%"
                mode="multiple"
                allow-clear
              >
                <a-select-option
                  v-for="(dict, index) in carStatusOptions"
                  :key="index"
                  :value="dict.dictValue"
                  >{{ dict.dictLabel }}</a-select-option
                >
              </a-select>
            </a-form-model-item>
          </a-col>
          <a-col :span="12">
            <a-form-model-item label="最低星级" prop="level">
              <a-select
                placeholder="请选择最低星级"
                v-model="form.level"
                :getPopupContainer="
                  (triggerNode) => {
                    return triggerNode.parentNode || document.body;
                  }
                "
                style="width: 100%"
                allow-clear
              >
                <a-select-option
                  v-for="(dict, index) in levelOptions"
                  :key="index"
                  :value="dict.dictValue"
                  >{{ dict.dictLabel }}</a-select-option
                >
              </a-select>
            </a-form-model-item>
          </a-col>
          <a-col :span="12">
            <a-form-model-item label="跟进状态" prop="progress">
              <a-select
                placeholder="请选择跟进状态"
                v-model="form.progress"
                :getPopupContainer="
                  (triggerNode) => {
                    return triggerNode.parentNode || document.body;
                  }
                "
                style="width: 100%"
                mode="multiple"
                allow-clear
              >
                <a-select-option
                  v-for="(dict, index) in progressOptions"
                  :key="index"
                  :value="dict.dictValue"
                  >{{ dict.dictLabel }}</a-select-option
                >
              </a-select>
            </a-form-model-item>
          </a-col>
          <a-col :span="12">
            <a-form-model-item label="最低评估价格" prop="pgPrice">
              <a-input-number
                v-model="form.pgPrice"
                :min="0"
                :max="10000"
                placeholder="最小值"
                :formatter="(value) => `${value}万`"
                :parser="(value) => value.replace('万', '')"
                :precision="1"
                style="width: 100%"
              />
            </a-form-model-item>
          </a-col>
          <a-col :span="12">
            <a-form-model-item label="客户数量上限/天" prop="maxCount">
              <a-input-number
                v-model="form.maxCount"
                :min="0"
                style="width: 100%"
              />
            </a-form-model-item>
          </a-col>
          <a-col :span="12">
            <a-form-model-item label="当日已分配客户数量" prop="shareCount">
              <a-input-number
                v-model="form.shareCount"
                :min="0"
                style="width: 100%"
                disabled
              />
            </a-form-model-item>
          </a-col>
        </a-row>
      </a-spin>
      <div class="bottom-control">
        <a-space>
          <a-button @click="cancel"> 取消 </a-button>
          <a-button type="primary" @click="submitForm"> 保存 </a-button>
        </a-space>
      </div>
    </a-form-model>
  </a-drawer>
</template>
<script>
import BizCustomerFilterEditForm from "./BizCustomerFilterForm";
export default {
  ...BizCustomerFilterEditForm,
};
</script>
